import request from '@/utils/request'

// 查询教学计划列表
export function listPlan(query) {
  return request({
    url: '/teaching/teaching_plan/list',
    method: 'get',
    params: query
  })
}

// 查询教学计划详细
export function getPlan(id) {
  return request({
    url: '/teaching/teaching_plan/' + id,
    method: 'get'
  })
}

// 新增教学计划
export function addPlan(data) {
  return request({
    url: '/teaching/teaching_plan',
    method: 'post',
    data: data
  })
}

// 修改教学计划
export function updatePlan(data) {
  return request({
    url: '/teaching/teaching_plan',
    method: 'put',
    data: data
  })
}

// 删除教学计划
export function delPlan(ids) {
  return request({
    url: '/teaching/teaching_plan/batch/' + ids,
    method: 'delete'
  })
}


// 查询教学计划列表-非分页（查询所有）
export function listAllPlan(query) {
  return request({
    url: '/teaching/teaching_plan/listall',
    method: 'get',
    params: query
  })
}

export function previewTeachingPlan(data) {
  return request({
    url: '/teaching/teaching_plan/preview',
    method: 'post',
    data: {
      beginDate:data.beginDate,
      className:data.className,
      stage:data.stage
    }
  })
}

export function addWorkday(data) {
  return request({
    url: '/teaching/teaching_plan/addWorkday',
    method: 'post',
    data: data
  })
}

export function addHoliday(data) {
  return request({
    url: '/teaching/teaching_plan/addHoliday',
    method: 'post',
    data: data
  })
}

// 清除调休配置
export function clearConfig(query) {
  return request({
    url: '/teaching/teaching_plan/clearConfig',
    method: 'get',
    params: query
  })
}
